]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Network: show Not Connected instead of Off when wifi radio is on
authorGiovanni Campagna <gcampagna@src.gnome.org>
Wed, 2 Oct 2013 14:48:35 +0000 (16:48 +0200)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Wed, 9 Oct 2013 16:39:44 +0000 (18:39 +0200)
When wifi is powered but not connected, show Not Connected instead
of off. This avoids a Off status next to a Turn Off menu item.

https://bugzilla.gnome.org/show_bug.cgi?id=709043

js/ui/status/network.js

index 598b5bb5dae6d4cca7f9140c142bd156afdf78a3..78e44f3954b8f21f58ca4ba703dcc62c97ed5cd5 100644 (file)
@@ -1072,10 +1072,17 @@ const NMDeviceWireless = new Lang.Class({
 
     _getStatus: function() {
         let ap = this._device.active_access_point;
-        if (!ap)
-            return _("Off"); // XXX -- interpret actual status
 
-        return ssidToLabel(ap.get_ssid());
+        if (ap)
+            return ssidToLabel(ap.get_ssid());
+        else if (!this._client.wireless_hardware_enabled)
+            return _("Hardware Disabled");
+        else if (!this._client.wireless_enabled)
+            return _("Off");
+        else if (this._device.state == NetworkManager.DeviceState.DISCONNECTED)
+            return _("Not Connected");
+        else
+            return '';
     },
 
     _getMenuIcon: function() {